Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Latest commit

 

History

History
19 lines (14 loc) · 546 Bytes

6.3.6 - Table->decr.md

File metadata and controls

19 lines (14 loc) · 546 Bytes

Table->decr

原子自减操作。

function Table->decr(string $key, string $column, mixed $decrby = 1) int | float;

参数

  • $key 指定数据的key,如果$key对应的行不存在,底层会首先将该行数据初始化为0
  • $column 指定列名,仅支持浮点型和整型字段
  • $decrby 减量,默认为1。如果列为整形,$decrby必须为int型,如果列为浮点型,$decrby必须为float类型

返回值

  • 返回最终的结果数值

数值为0时递减会变成负数